package com.example.miaosh.code;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 拦截配置--调用链
 */
@SuppressWarnings("deprecation")
@Configuration
public class WebAppConfigurer extends WebMvcConfigurerAdapter {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		String[] patterns = new String[] { "/user/login", "/user/register", "/user/getotp", "/user/get", "/user/login1",
				"/item/core", "/item/addOrderCoreId", "/item/list", "/item/find", "/item/add", "/*.html",
				"/swagger-resources/**" };
		registry.addInterceptor(new SysInterceptor()).addPathPatterns("/**").excludePathPatterns(patterns);
		super.addInterceptors(registry);
	}

}